package com.gec.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.model.entity.SysComplaint;
import com.gec.model.entity.SysRepair;
import com.gec.model.vo.SysComplaintVo;
import com.gec.system.mapper.SysCommunityMapper;
import com.gec.system.mapper.SysComplaintMapper;
import com.gec.system.service.SysComplaintService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 投诉表 服务实现类
 * </p>
 *
 * @author lmd
 * @since 2023-12-08
 */
@Service
public class SysComplaintServiceImpl extends ServiceImpl<SysComplaintMapper, SysComplaint> implements SysComplaintService {

    @Autowired
    private SysComplaintMapper sysComplaintMapper;


    @Override
    public IPage<SysComplaint> selectPage(IPage<SysComplaint> iPage, SysComplaintVo sysComplaintVo) {
        return this.sysComplaintMapper.selectPage(iPage,sysComplaintVo);
    }

    @Override
    public void updateRepairStatus(Long id, Integer status) {

        //1.查询出当前投诉信息
        SysComplaint sysComplaint = this.baseMapper.selectById(id);
        //2.设置状态
        sysComplaint.setStatus(status);
        //3.更新
        this.baseMapper.updateById(sysComplaint);
    }
}
